<?php

require_once("../util/db.php");

$username = $_POST['username'];
$password = $_POST['password'];

$sql = "SELECT * FROM user WHERE username ='$username' AND password = '$password'";

$retval = mysqli_query($conn,$sql);
if(!$retval){
    die('无法读取数据:'. mysqli_error($conn));
}
$rows=mysqli_fetch_all($retval);

if (count($rows)>0) {
    echo"登陆成功";
    header('Location: ../pages/Neast163.html');
} else {
    header('Location: ../pages/Neastelogin.html?flag=204&msg=登陆失败');
}

mysqli_free_result($retval);
mysqli_close($conn);
